from rest_framework import serializers
from disease.models import DiseaseDirectionModel, DiseaseCategoryModel,DiseaseModel,DiseaseMessageModel

# 方向
class DiseaseDirectionSerializer(serializers.ModelSerializer):
    class Meta:
        model = DiseaseDirectionModel
        fields = ['id','name']

# 分类
class DiseaseCategorySerializer(serializers.ModelSerializer):
    class Meta:
        model = DiseaseCategoryModel
        fields = ['id','name']

class DiseaseSerializer(serializers.ModelSerializer):

    class Meta:
        model = DiseaseModel
        fields = '__all__'

class DiseaseMessageSerializer(serializers.ModelSerializer):
    class Meta:
        model = DiseaseMessageModel
        fields = '__all__'

class MessageSerializer(serializers.ModelSerializer):
    class Meta:
        model = DiseaseMessageModel
        fields = ['id','name','content','pub_date','author','cover']